package com.jn.exam.question.service;

import com.jn.exam.question.entity.PaperQuestion;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;
import java.util.Map;
import java.util.concurrent.Future;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author 江南大学1033190417
 * @since 2022-02-06
 */
public interface PaperQuestionService extends IService<PaperQuestion> {

    //根据id交换两题位置
    boolean exchangeLocationById(Map<String, Object> param);



    //往试卷添加总题库试题(异步)
    Future<Boolean> addQuestionToPaper(String paperId, String questionId, Float location, Float score);

    //往试卷添加个人题库试题
    Future<Boolean> addPersonalQuestionToPaper(String paperId, String personalQuestionId, Float location, Float score);

    //考生参加考试拿到试题
    List<PaperQuestion> takeOneExam(String paperId,String studentId);

    //老师批阅试卷拿到试题，包括正确答案和学生答案
    List<PaperQuestion> markingStudentPaper(String paperId, String studentId);

    /**
     * 拿到学生被阅卷的状态
     * @param examId  考试id
     * @param studentId  学生id
     * @return 状态
     */
    Integer getExamStudentMarkStatus(String examId,String studentId);

    /**
     * 修改学生被阅卷的状态
     * @param examId 考试id
     * @param studentId 学生id
     * @param status 将要修改的状态
     * @return  是否成功
     */
    boolean updateExamStudentStatus(String examId,String studentId,Integer status);
}